package ticker

import (
	"time"
	"video_-chat/global"
)

func Delete() {
	ticker := time.NewTicker(time.Hour * 24)
	for _ = range ticker.C {
		DLine := time.Now().AddDate(0, 0, -30)
		global.DB.Exec("delete table messages where send_time < ?", DLine)
	}
}
